package com.ss.android.article.base.feature.search;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.View;

import com.ss.android.article.base.feature.splash.SplashAdActivity;
import com.ss.android.article.browser.R;
import com.ss.android.newmedia.activity.FragmentActivity;

public class BaseDiscoverActivity extends FragmentActivity {
    public BaseDiscoverActivity() {

    }

    public int getDayBackgroundRes() {
        return R.color.pg;
    }

    public int getLayout() {
        return R.layout.fragment_activity;
    }

    public int getNightBackgroundRes() {
        return R.color.ph;
    }

    public void init() {
        super.init();
        this.mTitleBar.setVisibility(View.GONE);
        Bundle v0 = new Bundle();
        v0.putBoolean("new_arch", false);
        m v1 = new m();
        v1.setArguments(v0);
        FragmentTransaction v0_1 = this.getSupportFragmentManager().beginTransaction();
        v0_1.replace(com.ss.android.article.browser.R.id.fragment_container, ((Fragment)v1), "find_fragment");
        v0_1.commitAllowingStateLoss();
        this.getWindow().setSoftInputMode(2);
    }

    public void onBackPressed() {
        int v0_1;
        Fragment v0 = this.getSupportFragmentManager().findFragmentByTag("find_fragment");
        if((v0 instanceof m)) {
            if(((m)v0).a != null && (((m)v0).a.q())) {
                v0_1 = 1;
            }else {
                v0_1 = 0;
            }
        }
        else {
            v0_1 = 0;
        }

        if(v0_1 == 0) {
            this.finish();
        }
    }

    public void onCreate(Bundle savedInstanceState) {
        this.requestDisableOptimizeViewHierarchy();
        super.onCreate(savedInstanceState);
    }

    public void onResume() {
        super.onResume();
        SplashAdActivity.a(((Context)this), false);
    }

    public boolean useSwipeRight() {
        return true;
    }
}

